]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Don't pop up on touch events
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 9 Oct 2017 10:53:04 +0000 (12:53 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 16 Jan 2018 16:41:46 +0000 (17:41 +0100)
We want touch events to enable the keyboard and focus tracking, but
not to actually show it right away. Implement that behavior by only
changing the visibility of the keyboard when triggered by a GSettings
change.

https://bugzilla.gnome.org/show_bug.cgi?id=788188

js/ui/keyboard.js

index 771f23dc249899b8b0fe1e8be2400a95122f6dff..1a251b582316572aeb74aa95f51cc10bf2683ee2 100644 (file)
@@ -308,6 +308,7 @@ var Keyboard = new Lang.Class({
     },
 
     _syncEnabled: function () {
+        let wasEnabled = this._enableKeyboard;
         this._enableKeyboard = this._a11yApplicationsSettings.get_boolean(SHOW_KEYBOARD);
         this._enabled = this._enableKeyboard || this._lastDeviceIsTouchscreen();
         if (!this._enabled && !this._keyboard)
@@ -315,14 +316,13 @@ var Keyboard = new Lang.Class({
 
         this._setCaretTrackerEnabled(this._enabled);
 
-        if (this._enabled) {
-            if (!this._keyboard)
-                this._setupKeyboard();
-            else
-                Main.layoutManager.showKeyboard();
-        } else {
+        if (this._enabled && !this._keyboard)
+            this._setupKeyboard();
+
+        if (this._enableKeyboard && !wasEnabled)
+            Main.layoutManager.showKeyboard();
+        else if (!this._enableKeyboard && wasEnabled)
             Main.layoutManager.hideKeyboard(true);
-        }
     },
 
     _sync: function () {